package repository

import (
	"gitee.com/fierce_wolf/go-fox-edge-common/commLogger"
	"gitee.com/fierce_wolf/go-fox-edge-common/commUtil/Method"
	"gitee.com/fierce_wolf/go-fox-edge-common/commUtil/periodTask"
)

type RepoLocalAppScanTask struct {
	AppType string
}

func (e *RepoLocalAppScanTask) TaskType() periodTask.TaskType {
	return periodTask.TaskOnce
}

func (e *RepoLocalAppScanTask) SchedulePeriod() int64 {
	return 1
}

func (e *RepoLocalAppScanTask) Execute() {
	// 简单验证
	if Method.HasEmpty(e.AppType) {
		commLogger.Console.Error("参数不能为空: AppType")
		return
	}

	LocalApplication.updateRepoCompEntityByAppType(e.AppType)
}
